import useCopyToClipboard from '@/hooks/useCopyToClipboard'
import FileCopyOutlinedIcon from '@mui/icons-material/FileCopyOutlined'

const CopyButton = ({ value }: { value: string }) => {
  const [isCopied, copyToClipboard] = useCopyToClipboard()
  return (
    <IconButton onClick={() => copyToClipboard(value)}>
      <FileCopyOutlinedIcon color={isCopied ? 'primary' : 'inherit'} sx={{ fontSize: 16 }} />
    </IconButton>
  )
}

export default CopyButton
